home *** CD-ROM | disk | FTP | other *** search
- Path: seagull.rtd.com!collins
- From: collins@RTD.COM (Ronald Collins)
- Newsgroups: comp.lang.c
- Subject: Re: Standard question - pointer initialization
- Date: 13 Mar 1996 20:59:26 GMT
- Organization: RTD Internet Access
- Message-ID: <4i7cve$5da@baygull.rtd.com>
- References: <4hk9un$906@hammer.msfc.nasa.gov> <4hl6rr$nde@news.xs4all.nl> <313E6028.1C19@ix.netcom.com> <4hnpsl$g8c@hacgate2.hac.com> <4hq9hsINN998@keats.ugrad.cs.ubc.ca> <4i7cgn$5da@baygull.rtd.com>
- NNTP-Posting-Host: seagull.rtd.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Ronald Collins (collins@RTD.COM) wrote:
- : Kazimir Kylheku (c2a192@ugrad.cs.ubc.ca) wrote:
-
- : : Also note that NULL is just a macro that stands for the value zero (often
- : : accompanied by a cast to void *). In assigning default initialization values to
- : : static variables, the compiler couldn't care less that there is a pre-processor
- : : macro called NULL. NULL can never be anything other than zero in a
- : : standard-conforming implementation of the C language.
-
- : This may be true on _your_ implementation, but nothing in the standard
- : requires the NULL value to be numerically 0.
-
- : Please read the FAQ before posting on the subject again.
-
- : -- collins --
-
- To follow-up on my own post ... the standard requires a zero to be
- used as NULL _only_ when the literal "0" is used. A variable set to
- 0 (as in "int var = 0;") then cast to a pointer (as in "*p = (char *) var")
- is _not_ required to convert to a NULL.
-
- If, above, you were talking about a literal "0", then I withdraw my comments.
- If you were talking of any numeric 0 value casting to a NULL, then my
- comments stand.
-
- -- collins --
-
-